<template>
    <div id="login">
        <div id="login_content">
            <div class="login_title">远程医疗业务协同系统</div>
            <div>
                <a-form-model :model="form" class="login-form" @click="login" :rules="rules">
                    <a-form-model-item prop="username">
                        <a-input v-model="form.username" placeholder="请输入您的账号"/>
                    </a-form-model-item>
                    <a-form-model-item prop="password">
                        <a-input-password v-model="form.password" placeholder="请输入您的密码"/>
                    </a-form-model-item>
                    <a-button type="primary" block :loading="loading" @keydown="login" @click="login">注册</a-button>
                    <a-form-model-item prop="remember">
                        <a-checkbox v-bind:style="{textAlign:'left'}" v-model="form.remember">重置</a-checkbox>
                    </a-form-model-item>
                </a-form-model>
            </div>
        </div>
    </div>
</template>

<script>

import axios from "@/utils/axios";
import model from '@/utils/config';
import {test, aaa} from '@/utils/axios';

export default {
    name: "Login",
    data() {
        return {
            wrapperCol: {span: 14},
            loading: false,
            form: {
                userName: "",
                password: "",
                remember: false
            },
            rules: {
                username: {required: true, message: '请输入账号', trigger: 'blur'},
                password: {required: true, message: '请输入密码', trigger: 'blur'}
            }
        }
    },
    methods: {
        login() {
            this.loading = true;
            this.loading = false;
            try {
                axios.post(model.baseUrl + "/login").then(res => {
                    console.log(res);
                    // test(aaa);
                    // aaa();
                    // this.storage();
                    this.test();
                    this.aaa();
                });


            } catch (e) {
                console.log(e);
            }
        },
        async storage() {
            await test();
            await aaa();
        },
        async xxx() {
            await console.log(1);
        }

    }
}
</script>

<style scoped>
#login {
    width: 100%;
    height: 100%;
    position: absolute;
    margin: 0 auto;
}

#login_content {
    position: absolute;
    width: 420px;
    height: 300px;
    top: 30%;
    left: 38%;
}

.login_title {
    width: 100%;
    height: 30%;
    box-sizing: border-box;
    text-align: center;
    font: 30px "宋体";
    color: #fff;
    font-weight: bold;
}
</style>
